
// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
  "name": {
    "rules": [
      {
        "format": "string"
      },
      {
        "maxLength": 50
      }
    ],
    "label": "表单名称"
  },
  "desc": {
    "rules": [
      {
        "format": "string"
      },
      {
        "maxLength": 200
      }
    ],
    "label": "表单简介"
  },
  "head_image": {
    "rules": [
      {
        "format": "file"
      }
    ],
    "label": "封面图"
  },
  "islogin": {
    "rules": [
      {
        "required": true
      },
      {
        "format": "int"
      },
      {
        "range": [
          {
            "value": 0,
            "text": "无需登录"
          },
          {
            "value": 1,
            "text": "需要登录"
          }
        ]
      }
    ],
    "defaultValue": 0,
    "label": "是否需要登录"
  },
  "times": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "defaultValue": 1,
    "label": "可提交次数"
  },
  "sort": {
    "rules": [
      {
        "required": true
      },
      {
        "format": "int"
      }
    ],
    "defaultValue": 100,
    "label": "排序"
  },
  "end_date": {
    "rules": [
      {
        "format": "timestamp"
      }
    ],
    "label": "到期时间"
  }
}

const enumConverter = {
  "islogin_valuetotext": {
    "0": "无需登录",
    "1": "需要登录"
  }
}

export { validator, enumConverter }
